home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
113_01
/
a15.doc
< prev
next >
Wrap
Text File
|
1985-03-09
|
30KB
|
851 lines
/*
HEADER: CUG113;
TITLE: 1802 Cross-Assembler (BDS C Version);
FILENAME: A15.DOC;
VERSION: 1.2;
DATE: 07/22/1985;
DESCRIPTION: "This program lets you use your CP/M-80-based computer
to assemble code for the RCA 1802, 1804, 1805, 1805A,
1806, AND 1806A microprocessors. The program is
written in BDS C for the best possible performance on
8-bit machines. All assembler features are supported
except relocation, linkage, listing control, and
macros.";
KEYWORDS: Software Development, Assemblers, Cross-Assemblers,
RCA, CDP1802, CDP1805A;
SEE-ALSO: CUG149, 1805A Cross-Assembler (Portable);
SYSTEM: CP/M-80;
COMPILERS: BDS C;
WARNINGS: "This package is specifically tailored to CP/M-80
machines and the rather non-standard, but high-
performance BDS C compiler. For other environments,
use the portable version of this package on CUG149.";
AUTHORS: William C. Colley III;
*/
1805A/1802 Cross-assembler
Version 1.2
Copyright (c) 1980, 82, 83, 85 William C. Colley III
The Manual Such As It Is.
1805A Cross-assembler User Manual Page 1
Table of Contents
1.0 Format of Cross-assembler Commands........................ 2
1.1 Command Strings........................................... 2
1.2 Options................................................... 2
1.3 Examples.................................................. 2
2.0 Format of Cross-assembler Source Files.................... 4
2.1 Statements................................................ 4
2.2 Symbols................................................... 5
2.3 Numeric Constants......................................... 5
2.4 Strings................................................... 6
3.0 Expression Evaluation..................................... 7
4.0 1805A Instructions........................................ 8
4.1 No Argument Group......................................... 8
4.2 Register Group............................................ 8
4.3 8-bit Immediate Group..................................... 8
4.4 Short Branch Group........................................ 9
4.5 Long Branch Group......................................... 9
4.6 Input/Output Group........................................ 9
4.7 2-Argument Group.......................................... 9
5.0 Pseudo-operations.........................................10
5.1 BLK.......................................................10
5.2 BYTE......................................................10
5.3 Conditional Assembly......................................10
5.4 CPU.......................................................11
5.5 END.......................................................11
5.6 EQU.......................................................12
5.7 LOAD......................................................12
5.8 ORG.......................................................12
5.9 PAGE......................................................13
5.10 SET.......................................................13
5.11 TEXT......................................................13
5.12 WORD......................................................13
6.0 Error Messages.................................................14
7.0 Assembler Abort Conditions.....................................16
8.0 Compiling the Assembler........................................17
9.0 Final Comments.................................................18
1805A Cross-assembler User Manual Page 2
1.0 Format of Cross-assembler Commands
1.1 Command Strings
To run the 1805A cross-assembler, type the following command
line:
A>a15 filename options
filename: The name of the source input file is filename.rca,
the list can go to filename.prn, and the hex file
can go to filename.hex. If any type is appended
to the filename, it is ignored.
options: See next section.
1.2 Options
The source file comes from the currently logged disk drive unless
it is redirected by putting the string "sd" in the options field.
"s" specifies the source file and "d" is a device code from the
following list:
a, b, c, d disk drives
- the currently logged-in disk drive
Lines of input containing errors will always be output to the
console device. If the full listing is desired, it must be
called for by putting the string "ld" in the options field. "l"
specifies the list file and "d" is a device code as per the
source file or one of the following:
x console device
y list device
The hex file will not be output unless called for with the string
"hd" with device codes as per the list file.
Options must be run together into a single string with no
embedded blanks.
1.3 Examples
A>a15 barf source -- a:barf.rca
list -- none
hex -- none
A>a15 barf sblxha source -- b:barf.rca
list -- con:
hex -- a:barf.hex
1805A Cross-assembler User Manual Page 3
A>a15 barf ly source -- a:barf.rca
list -- lst:
hex -- none
A>b:a15 barf sbh- source -- b:barf.rca
list -- none
hex -- a:barf.hex
B>a:a15 barf h- source -- b:barf.rca
list -- none
hex -- b:barf.rca
1805A Cross-assembler User Manual Page 4
2.0 Format of Cross-assembler Source Files
Lines of source input are terminated with CR/LF pairs.
Internally, the character before the LF is discarded, so if the
CR is missing, the last character of the line will be eaten up.
The internal line buffer will hold a 120-character line. This
may be changed by altering the "#define LINLEN 120" statement in
a15.h and recompiling the cross-assembler. Excess characters in
the line are thrown out.
Lower case letters are converted to upper case in as few places
as possible. They are:
1) In opcodes,
2) In checking for keywords such as NOT, and
3) In command strings.
This means that "not", "NOT", "Not", etc. are all possible
spellings of the logical inversion operator. This also means
that "foo" and "FOO" are different symbols. Watch this if you
start encountering U errors of symbols that you "know" you
defined.
2.1 Statements
Source files input to the cross-assembler consist of statements
of the form:
[label] [opcode [arguments]] [;comments]
Labels are recognized by their beginning in column 1. If it
doesn't begin there, it is assumed to be an opcode. Labels are
assigned the current program counter value unless the line's
opcode is "EQU" or "SET".
Opcodes may be either 1805A machine instruction mnemonics or
pseudo-ops (i.e. assembler directives).
The arguments following the opcode will vary with the opcode. In
the case of opcodes such as "NOP", they may be absent entirely.
Lines terminate with either a CR/LF pair or a semicolon that is
not embedded in a quoted string. Anything after a semicolon is
ignored by the assembler, but will appear in the listing. Note
that a semico